翻訳と辞書
Words near each other
・ Cursinu
・ Cursive
・ Cursive (band)
・ Cursive discography
・ Cursive handwriting instruction in the United States
・ Cursive Hebrew
・ Cursive hieroglyphs
・ Cursive script
・ Cursive script (East Asia)
・ Curso de Orientación Universitaria
・ Cursolo-Orasso
・ Curson (disambiguation)
・ Curson baronets
・ CURSOR
・ Cursor
Cursor (databases)
・ Cursor (user interface)
・ Cursor editor
・ Cursor grass mouse
・ Cursor Miner
・ Cursor Models
・ Cursor Mundi
・ Cursor's Fury
・ Cursores
・ Cursorial
・ Cursorius
・ Cursus
・ Cursus (classical)
・ Cursus honorum
・ Cursus publicus


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Cursor (databases) : ウィキペディア英語版
Cursor (databases)
In computer science, a database cursor is a control structure that enables traversal over the records in a database. Cursors facilitate subsequent processing in conjunction with the traversal, such as retrieval, addition and removal of database records. The database cursor characteristic of traversal makes cursors akin to the programming language concept of iterator.
Cursors are used by database programmers to process individual rows returned by database system queries. Cursors enable manipulation of whole result sets at once. In this scenario, a cursor enables the rows in a result set to be processed sequentially.
In SQL procedures, a cursor makes it possible to define a result set (a set of data rows) and perform complex logic on a row by row basis. By using the same mechanics, an SQL procedure can also define a result set and return it directly to the caller of the SQL procedure or to a client application.
A cursor can be viewed as a pointer to one row in a set of rows. The cursor can only reference one row at a time, but can move to other rows of the result set as needed.
==Usage==
To use cursors in SQL procedures, you need to do the following:
# Declare a cursor that defines a result set.
# Open the cursor to establish the result set.
# Fetch the data into local variables as needed from the cursor, one row at a time.
# Close the cursor when done.
To work with cursors you must use the following SQL statements
This section introduces the ways the SQL:2003 standard defines how to use cursors in applications in embedded SQL. Not all application bindings for relational database systems adhere to that standard, and some (such as CLI or JDBC) use a different interface.
A programmer makes a cursor known to the DBMS by using a DECLARE ... CURSOR statement and assigning the cursor a (compulsory) name:
DECLARE ''cursor_name'' CURSOR IS SELECT ... FROM ...
Before code can access the data, it must open the cursor with the OPEN statement. Directly following a successful opening, the cursor is positioned ''before'' the first row in the result set.
OPEN ''cursor_name''
Programs position cursors on a specific row in the result set with the FETCH statement. A fetch operation transfers the data of the row into the application.
FETCH ''cursor_name'' INTO ...
Once an application has processed all available rows or the fetch operation is to be positioned on a non-existing row (compare scrollable cursors below), the DBMS returns a SQLSTATE '02000' (usually accompanied by an SQLCODE +100) to indicate the end of the result set.
The final step involves closing the cursor using the CLOSE statement:
CLOSE ''cursor_name''
After closing a cursor, a program can open it again, which implies that the DBMS re-evaluates the same query or a different query and builds a new result set.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Cursor (databases)」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.